package com.coderman.tianhua.idgenerator.common.enums;

/**
 * Description:
 * date: 2020/10/28
 *
 * @author fanchunshuai
 * @version 1.0.0
 * @since JDK 1.8
 */
public enum  Status {
    //停止
    STOP((byte) 0),
    //启用
    RUNNING((byte) 1);
    private Byte value;

    Status(Byte value) {
        this.value = value;
    }

    public Byte getValue() {
        return value;
    }
    public static Status getStatus(Byte value) {
        for (Status status : Status.values()) {
            if (status.value.equals(value)) {
                return status;
            }
        }
        throw new IllegalArgumentException("value[" + value + "] 不存在");
    }
}
